package com.emergency.db.dao.nuclear;

import com.emergency.db.domain.nuclear.Shell;
import com.emergency.db.domain.nuclear.Vessel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface ShellDao extends JpaRepository<Shell, Long>, JpaSpecificationExecutor<Shell> {
    @Modifying
    @Query(value = "delete FROM bas_nuclear_shell WHERE inside_id = ? ", nativeQuery = true)
    void deleteByNuclear(Long id);

    @Query("select sh from Shell sh where inside.id=:id ")
    Shell findByNuclear(@Param("id") Long id);
}
